import { createWebHistory, createRouter } from 'vue-router'

import home from '@renderer/views/home.vue'
import listLog from '@renderer/views/logs/list.vue'
import sigleLog from '@renderer/views/logs/sigle.vue'
import team from '@renderer/views/team/index.vue'
import teamList from '@renderer/views/team/list.vue'
import projList from '@renderer/views/proj/list.vue'
import projEdit from '@renderer/views/proj/edit.vue'
import compList from '@renderer/views/comp/list.vue'
import compEdit from '@renderer/views/comp/edit.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: home,
    redirect: { name: 'log.list' },
    children: [
      { path: '/log/list', name: 'log.list', component: listLog },
      { path: '/log/:id', name: 'sigleLog', component: sigleLog },
      { path: '/team/:id', name: 'team', component: team },
      { path: '/team/list', name: 'team.list', component: teamList },
      { path: '/proj/list', name: 'proj.list', component: projList },
      { path: '/proj/edit/:id', name: 'proj.edit', component: projEdit },
      { path: '/comp/list', name: 'comp.list', component: compList },
      { path: '/comp/edit/:id', name: 'comp.edit', component: compEdit },
    ],
  },
]

export const router = createRouter({
  history: createWebHistory(),
  routes,
})
